package com.design_patterns.prototype;


/**
 * @author: 李德才
 * @description:
 * @create: 2020-09-19 15:08
 **/
public class Person implements Cloneable{
    private Integer id;
    private String name;
    private Integer age;
    private Integer sex;
    private Address address;


    @Override
    protected Object clone() throws CloneNotSupportedException {
//        Person p = (Person)super.clone();
//        p.address = (Address)address.clone();
//        return p;
        return super.clone();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }
}
